home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 January: Mac OS SDK / Dev.CD Jan 96 SDK / Dev.CD Jan 96 SDK1.toast / Development Kits (Disc 1) / AOCE / Development Tools / Interfaces / CIncludes / ADSPSecure.h next >
Encoding:
C/C++ Source or Header  |  1993-11-10  |  4.2 KB  |  138 lines  |  [TEXT/MPS ]

  1. /************************************************************
  2.  
  3. Created: Friday, June 4, 1993 at 10:05AM
  4.  ADSPSecure.h
  5.  C Interface to the Macintosh Libraries
  6.  
  7.   Copyright Apple Computer, Inc. 1990-1993
  8.   All rights reserved
  9.  
  10. ************************************************************/
  11.  
  12.  
  13. #ifndef __ADSPSECURE__
  14. #define __ADSPSECURE__
  15.  
  16. #ifndef __ADSP__
  17. #include <ADSP.h>
  18. #endif
  19.  
  20. #ifndef __FILES__
  21. #include <Files.h>
  22. #endif
  23.  
  24. #ifndef __OCE__
  25. #include <OCE.h>
  26. #endif
  27.  
  28. #ifndef __OCEAUTHDIR__
  29. #include <OCEAuthDir.h>
  30. #endif
  31.  
  32. #ifndef __TYPES__
  33. #include <Types.h>
  34. #endif
  35.  
  36.  
  37. /* New ADSP control codes */
  38.  
  39. enum {sdspOpen        = 229};            /* open a secure connection */
  40.  
  41.  
  42.  
  43. /*
  44. For secure connections, the eom field of ioParams contains two single-bit flags
  45. (instead of a zero/non-zero byte). They are an encrypt flag (see below), and an
  46. eom flag.  All other bits in that field should be zero.
  47.  
  48. To write an encrypted message, you must set an encrypt bit in the eom field of
  49. the ioParams of your write call. Note: this flag is only checked on the first
  50. write of a message (the first write on a connection, or the first write following
  51. a write with eom set.
  52. */
  53.  
  54. enum {
  55.     dspEOMBit,            /* set if EOM at end of write */
  56.     dspEncryptBit        /* set to encrypt message */
  57. };
  58.  
  59. enum {
  60.     dspEOMMask            = 1<<dspEOMBit,
  61.     dspEncryptMask        = 1<<dspEncryptBit
  62. };
  63.  
  64.  
  65.  
  66. /*
  67. Define an ADSPSecure parameter block, as used for the secure Open call.
  68. */
  69.  
  70. #define sdspWorkSize    2048            /* size of ADSPSecure workspace */
  71.  
  72. struct TRSecureParams {
  73.     unsigned short    localCID;            /* local connection id */
  74.     unsigned short    remoteCID;            /* remote connection id */
  75.     AddrBlock        remoteAddress;        /* address of remote end */
  76.     AddrBlock        filterAddress;        /* address filter */
  77.     unsigned long    sendSeq;            /* local send sequence number */
  78.     unsigned short    sendWindow;            /* send window size */
  79.     unsigned long    recvSeq;            /* receive sequence number */
  80.     unsigned long    attnSendSeq;        /* attention send sequence number */
  81.     unsigned long    attnRecvSeq;        /* attention receive sequence number */
  82.     unsigned char    ocMode;                /* open connection mode */
  83.     unsigned char    ocInterval;            /* open connection request retry interval */
  84.     unsigned char    ocMaximum;            /* open connection request retry maximum */
  85.  
  86.     Boolean            secure;                /*  --> TRUE if session was authenticated */
  87.     AuthKeyPtr        sessionKey;            /* <--> encryption key for session */
  88.     unsigned long    credentialsSize;    /*  --> length of credentials */
  89.     Ptr                credentials;        /*  --> pointer to credentials */
  90.     Ptr                workspace;            /*  --> pointer to workspace for connection */
  91.                                         /* align on even boundary and length = sdspWorkSize */
  92.     AuthIdentity    recipient;            /*  --> identity of recipient (or initiator if active mode */
  93.     UTCTime            issueTime;            /*  --> when credentials were issued */
  94.     UTCTime            expiry;                /*  --> when credentials expiry */
  95.     RecordIDPtr        initiator;            /* <--  RecordID of initiator returned here.
  96.                                             Must give appropriate Buffer to hold RecordID
  97.                                             (Only for passive or accept mode) */
  98.     Boolean            hasIntermediary;    /* <--  will be set if credentials has an intermediary */
  99.     RecordIDPtr        intermediary;        /* <--  RecordID of intermediary returned here.
  100.                                             (If intermediary is found in credentials
  101.                                             Must give appropriate Buffer to hold RecordID
  102.                                             (Only for passive or accept mode) */
  103.     };
  104.  
  105. typedef struct TRSecureParams TRSecureParams;
  106.  
  107.  
  108. struct SDSPParamBlock {
  109.     struct QElem        *qLink;
  110.     short                qType;
  111.     short                ioTrap;
  112.     Ptr                    ioCmdAddr;
  113.     ProcPtr                ioCompletion;
  114.     OSErr                ioResult;
  115.     char                *ioNamePtr;
  116.     short                ioVRefNum;
  117.     short                ioCRefNum;        /* adsp driver refNum */
  118.     short                csCode;            /* adsp driver control code */
  119.     long                qStatus;        /* adsp internal use */
  120.     short                ccbRefNum;        /* connection end refNum */
  121.     union {
  122.         TRinitParams    initParams;        /* dspInit, dspCLInit */
  123.         TRopenParams    openParams;        /* dspOpen, dspCLListen, dspCLDeny */
  124.         TRcloseParams    closeParams;    /* dspClose, dspRemove */
  125.         TRioParams        ioParams;        /* dspRead, dspWrite */
  126.         TRattnParams    attnParams;        /* dspAttention */
  127.         TRstatusParams    statusParams;    /* dspStatus */
  128.         TRoptionParams    optionParams;    /* dspOptions */
  129.         TRnewcidParams    newCIDParams;    /* dspNewCID */
  130.         TRSecureParams    secureParams;    /* dspOpenSecure */
  131.     } u;
  132. };
  133.  
  134. typedef struct SDSPParamBlock SDSPParamBlock;
  135. typedef SDSPParamBlock *SDSPPBPtr;
  136.  
  137. #endif
  138.